<template>
    <div>
        <el-select placeholder="请选择" style="width: 150px" clearable filterable>
            <el-option label="全部" :value="1" />
            <el-option label="报关资料" :value="2" />
            <el-option label="清关资料" :value="3" />
        </el-select>
        <div v-for="item in state.tableData" :key="item" style="margin-top: 8px;">
            <div class="hearder">
                <div class="le">{{ item.time }}</div>
                <div @click="item.show = !item.show" class="ri">
                    {{ item.show ? '收起' : '展开' }}
                </div>
            </div>
            <el-collapse-transition>
                <div v-show="item.show">
                    <div class="export">批量导出</div>
                    <el-table :data="item.data" border style="width: 100%;margin-top: 8px;">
                        <el-table-column type="selection" width="40" />
                        <el-table-column sortable prop="file" label="报关资料文件">
                            <template #default="{ row }">
                                <span style="color: #3B78FF;cursor: pointer;">{{ row.file }}</span>
                            </template>
                        </el-table-column>
                        <el-table-column width="300" sortable prop="creator" label="创建人" />
                        <el-table-column width="300" sortable prop="createTime" label="创建时间" />
                        <el-table-column width="200" sortable label="操作">
                            <template #default="{ row }">
                                <span style="color: #3B78FF;cursor: pointer;margin-right: 10px;">详情</span>
                                <span style="color: #3B78FF;cursor: pointer;">导出</span>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
            </el-collapse-transition>
        </div>
    </div>
</template>
<script setup>

import { reactive } from 'vue'
const state = reactive({
    tableData: [
        {
            show: true,
            time: '2023-07-24',
            data: [
                { file: '报关单.excel', creator: '吴彦锦', createTime: '2024-05-25 07:31' },
                { file: '发票.excel', creator: '何远豪', createTime: '2024-05-25 07:31' },
                { file: '报关单.excel', creator: '吴彦锦', createTime: '2024-05-25 07:31' },
                { file: '发票.excel', creator: '何远豪', createTime: '2024-05-25 07:31' },
            ]
        },
        {
            show: true,
            time: '2023-07-23',
            data: [
                { file: '报关单.excel', creator: '吴彦锦', createTime: '2024-05-25 07:31' },
                { file: '发票.excel', creator: '何远豪', createTime: '2024-05-25 07:31' },
                { file: '报关单.excel', creator: '吴彦锦', createTime: '2024-05-25 07:31' },
                { file: '发票.excel', creator: '何远豪', createTime: '2024-05-25 07:31' },
            ]
        },
        {
            show: false,
            time: '2023-07-22',
            data: [
                { file: '报关单.excel', creator: '吴彦锦', createTime: '2024-05-25 07:31' },
                { file: '发票.excel', creator: '何远豪', createTime: '2024-05-25 07:31' },
                { file: '报关单.excel', creator: '吴彦锦', createTime: '2024-05-25 07:31' },
                { file: '发票.excel', creator: '何远豪', createTime: '2024-05-25 07:31' },
            ]
        },
    ]
})

</script>

<style lang="scss" scoped>
.hearder {
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 24px;
    background-color: #F5F8F7;
    padding: 2px 8px;

    .le {
        font-family: PingFang SC;
        font-weight: regular;
        font-size: 12px;
        line-height: 20px;
        text-align: left;
    }

    .ri {
        color: #3B78FF;
        font-family: PingFang SC;
        font-weight: regular;
        font-size: 12px;
        line-height: 20px;
        letter-spacing: 0px;
        cursor: pointer;
    }
}

.export {
    background: #F1F8FF;
    color: #3B78FF;
    border: 1px solid #F2F3F5;
    padding: 4px 16px;
    margin-top: 8px;
    cursor: pointer;
}
</style>